//------------------------------------------------------------------------------
//
//  Hemisson Drive Types
//
//  Written Dec-2007 by Trevor Taylor, Software Technology, Australia
//
//------------------------------------------------------------------------------

using Microsoft.Dss.Core.Attributes;
using System;
using System.Collections.Generic;

// Needed for attributes
using System.ComponentModel;
// For port stuff
using Microsoft.Ccr.Core;
// For Fault
using W3C.Soap;
// For standard Dssp types
using Microsoft.Dss.ServiceModel.Dssp;

using Microsoft.Dss.Core.DsspHttp;


namespace ProMRDS.Robotics.Hemisson.Drive
{
    /// <summary>
    /// HemissonDrive Contract
    /// </summary>
    public sealed class Contract
    {
        
        /// The Unique Contract Identifier for the HemissonDrive service
        public const String Identifier = "http://www.promrds.com/contracts/2008/01/hemissondrive.html";
    }

    // Additional (internal) operations

    [DisplayName("Stop Timed Motion")]
    [Description("Stops a specified motion request (if still active)")]
    public class StopMotion : Submit<StopMotionRequest, PortSet<DefaultSubmitResponseType, Fault>>
    {
        public StopMotion()
        {
        }
        public StopMotion(StopMotionRequest stop)
        {
            this.Body = stop;
        }
        public StopMotion(int num)
        {
            this.Body.AckNumber = num;
        }
    }

    [Description("Class to terminate a timed move -- Internal")]
    //    [DataContract]
    //    [DataMemberConstructor]
    public class StopMotionRequest
    {
        private int _num;

        [DataMember]
        [Description("Acknowledgement number")]
        public int AckNumber
        {
            get { return this._num; }
            set { this._num = value; }
        }
    }

    [DisplayName("HTTP Post Success")]
    [Description("Used for deferred posting of a HTTP Post success message")]
    public class HttpPostSuccess : Update<HttpPostSuccessRequest, PortSet<DefaultUpdateResponseType, Fault>>
    {
    }

    [Description("Provides details of successful HTTP Post -- Internal")]
    public class HttpPostSuccessRequest
    {
        public PortSet<DefaultUpdateResponseType, Fault> WaitPort;
        public HttpPost Submit;
    }

}
